<template>
    <div id="dialog-container">
        <el-dialog v-dialogDrag 
            title="详情" append-to-body
            :visible.sync="dialogVisible" @close="$emit('update:show', false)" :before-close="handleClose" :show="show"
            :close-on-click-modal="false" width="700px">
            <el-form :model="form" :inline="true" size="small" label-width="110px">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="任务类型：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="任务单号：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="下发人：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="下发日期：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="下发单位：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="送检人：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="送检单位：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="送检日期：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="接收人：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="接收日期：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="接收单位">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <el-table :data="tableData" border size="mini">
                <el-table-column type="index" label="序号" width="50" align="center" :resizable="false"></el-table-column>
                <el-table-column prop="id" label="计量器具状态" :resizable="false" min-width="100"></el-table-column>
                <el-table-column prop="" label="统一编号" :resizable="false" min-width="100"></el-table-column>
                <el-table-column prop="" label="使用部门" :resizable="false" min-width="100"></el-table-column>
                <el-table-column prop="" label="分类代码" :resizable="false" min-width="80"></el-table-column>
                <el-table-column prop="" label="器具名称" :resizable="false" min-width="80"></el-table-column>
                <el-table-column prop="" label="测量范围" :resizable="false" min-width="90"></el-table-column>
                <el-table-column prop="" label="检定周期" :resizable="false" min-width="90"></el-table-column>
                <el-table-column prop="" label="检定日期" :resizable="false" min-width="100"></el-table-column>
                <el-table-column prop="" label="有效日期" :resizable="false" min-width="100"></el-table-column>
            </el-table>
            <el-row type="flex" justify="center">
                <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage"
                    :page-sizes="pageSizeArr"
                    :page-size="pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="pageTotal"></el-pagination>
            </el-row>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
                <el-button @click="dialogVisible = false">取 消</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    import AddTest from 'dialog/test-manage/week-test-plan/add-wait-test';
    export default {
        components: {
            'add-test': AddTest
        },
        data() {
            return {
                dialogVisible: this.show,
                form: {
                    name: ''
                },
                tableData: [{
                    id: 'jidjia-89'
                }],
                pageSizeArr: [10, 20, 50],
                pageSize: 10,
                pageTotal: 20,
                currentPage: 1,
            }
        },
        props: {
            show: {
                type: Boolean,
                default: false
            }
        },
        watch: {
            show() {
                this.dialogVisible = this.show;
            }
        },
        methods: {
            handleClose() {
                this.dialogVisible = false;
            },
            handleSizeChange(val){
                // console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val){
                // console.log(`当前页: ${val}`);
            },
        }
    }
</script>
